home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / RIncludes / Sound.r < prev    next >
Encoding:
Text File  |  2000-04-12  |  9.7 KB  |  241 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        Sound.r
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    Sound Manager 3.3
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    © 1986-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17.  
  18. #ifndef __SOUND_R__
  19. #define __SOUND_R__
  20.  
  21. #ifndef __CONDITIONALMACROS_R__
  22. #include "ConditionalMacros.r"
  23. #endif
  24.  
  25. #define kInvalidSource                     0xFFFFFFFF            /* this source may be returned from GetInfo if no other source is the monitored source */
  26. #define kNoSource                         'none'                /* no source selection */
  27. #define kCDSource                         'cd  '                /* internal CD player input */
  28. #define kExtMicSource                     'emic'                /* external mic input */
  29. #define kSoundInSource                     'sinj'                /* sound input jack */
  30. #define kRCAInSource                     'irca'                /* RCA jack input */
  31. #define kTVFMTunerSource                 'tvfm'
  32. #define kDAVInSource                     'idav'                /* DAV analog input */
  33. #define kIntMicSource                     'imic'                /* internal mic input */
  34. #define kMediaBaySource                 'mbay'                /* media bay input */
  35. #define kModemSource                     'modm'                /* modem input (internal modem on desktops, PCI input on PowerBooks) */
  36. #define kPCCardSource                     'pcm '                /* PC Card pwm input */
  37. #define kZoomVideoSource                 'zvpc'                /* zoom video input */
  38. #define kDVDSource                         'dvda'                /* DVD audio input */
  39.  
  40. #define kNoSoundComponentType             '****'
  41. #define kSoundComponentType             'sift'                /* component type */
  42. #define kSoundComponentPPCType             'nift'                /* component type for PowerPC code */
  43. #define kRate8SubType                     'ratb'                /* 8-bit rate converter */
  44. #define kRate16SubType                     'ratw'                /* 16-bit rate converter */
  45. #define kConverterSubType                 'conv'                /* sample format converter */
  46. #define kSndSourceSubType                 'sour'                /* generic source component */
  47. #define kMixerType                         'mixr'
  48. #define kMixer8SubType                     'mixb'                /* 8-bit mixer */
  49. #define kMixer16SubType                 'mixw'                /* 16-bit mixer */
  50. #define kSoundInputDeviceType             'sinp'                /* sound input component */
  51. #define kWaveInSubType                     'wavi'                /* Windows waveIn */
  52. #define kWaveInSnifferSubType             'wisn'                /* Windows waveIn sniffer */
  53. #define kSoundOutputDeviceType             'sdev'                /* sound output component */
  54. #define kClassicSubType                 'clas'                /* classic hardware, i.e. Mac Plus */
  55. #define kASCSubType                     'asc '                /* Apple Sound Chip device */
  56. #define kDSPSubType                     'dsp '                /* DSP device */
  57. #define kAwacsSubType                     'awac'                /* Another of Will's Audio Chips device */
  58. #define kGCAwacsSubType                 'awgc'                /* Awacs audio with Grand Central DMA */
  59. #define kSingerSubType                     'sing'                /* Singer (via Whitney) based sound */
  60. #define kSinger2SubType                 'sng2'                /* Singer 2 (via Whitney) for Acme */
  61. #define kWhitSubType                     'whit'                /* Whit sound component for PrimeTime 3 */
  62. #define kSoundBlasterSubType             'sbls'                /* Sound Blaster for CHRP */
  63. #define kWaveOutSubType                 'wavo'                /* Windows waveOut */
  64. #define kWaveOutSnifferSubType             'wosn'                /* Windows waveOut sniffer */
  65. #define kDirectSoundSubType             'dsnd'                /* Windows DirectSound */
  66. #define kDirectSoundSnifferSubType         'dssn'                /* Windows DirectSound sniffer */
  67. #define kUNIXsdevSubType                 'un1x'                /* UNIX base sdev */
  68. #define kUSBSubType                     'usb '                /* USB device */
  69. #define kBlueBoxSubType                 'bsnd'                /* Blue Box sound component */
  70. #define kSoundCompressor                 'scom'
  71. #define kSoundDecompressor                 'sdec'
  72. #define kAudioComponentType             'adio'                /* Audio components and sub-types */
  73. #define kAwacsPhoneSubType                 'hphn'
  74. #define kAudioVisionSpeakerSubType         'telc'
  75. #define kAudioVisionHeadphoneSubType     'telh'
  76. #define kPhilipsFaderSubType             'tvav'
  77. #define kSGSToneSubType                 'sgs0'
  78. #define kSoundEffectsType                 'snfx'                /* sound effects type */
  79. #define kEqualizerSubType                 'eqal'                /* frequency equalizer */
  80. #define kSSpLocalizationSubType         'snd3'
  81.  
  82. #define kSoundNotCompressed             'NONE'                /* sound is not compressed */
  83. #define k8BitOffsetBinaryFormat         'raw '                /* 8-bit offset binary */
  84. #define k16BitBigEndianFormat             'twos'                /* 16-bit big endian */
  85. #define k16BitLittleEndianFormat         'sowt'                /* 16-bit little endian */
  86. #define kFloat32Format                     'fl32'                /* 32-bit floating point */
  87. #define kFloat64Format                     'fl64'                /* 64-bit floating point */
  88. #define k24BitFormat                     'in24'                /* 24-bit integer */
  89. #define k32BitFormat                     'in32'                /* 32-bit integer */
  90. #define kMACE3Compression                 'MAC3'                /* MACE 3:1 */
  91. #define kMACE6Compression                 'MAC6'                /* MACE 6:1 */
  92. #define kCDXA4Compression                 'cdx4'                /* CD/XA 4:1 */
  93. #define kCDXA2Compression                 'cdx2'                /* CD/XA 2:1 */
  94. #define kIMACompression                 'ima4'                /* IMA 4:1 */
  95. #define kULawCompression                 'ulaw'                /* µLaw 2:1 */
  96. #define kALawCompression                 'alaw'                /* aLaw 2:1 */
  97. #define kMicrosoftADPCMFormat             0x6D730002            /* Microsoft ADPCM - ACM code 2 */
  98. #define kDVIIntelIMAFormat                 0x6D730011            /* DVI/Intel IMA ADPCM - ACM code 17 */
  99. #define kDVAudioFormat                     'dvca'                /* DV Audio */
  100. #define kQDesignCompression             'QDMC'                /* QDesign music */
  101. #define kQUALCOMMCompression             'Qclp'                /* QUALCOMM PureVoice */
  102. #define kOffsetBinary                     'raw '                /* for compatibility */
  103. #define kTwosComplement                 'twos'                /* for compatibility */
  104. #define kLittleEndianFormat             'sowt'                /* for compatibility */
  105. #define kMPEGLayer3Format                 0x6D730055            /* MPEG Layer 3, CBR only (pre QT4.1) */
  106. #define kFullMPEGLay3Format             '.mp3'                /* MPEG Layer 3, CBR & VBR (QT4.1 and later) */
  107.  
  108. #define k8BitRawIn                         0x01                /* data description */
  109. #define k8BitTwosIn                     0x02
  110. #define k16BitIn                         0x04
  111. #define kStereoIn                         0x08
  112. #define k8BitRawOut                     0x0100
  113. #define k8BitTwosOut                     0x0200
  114. #define k16BitOut                         0x0400
  115. #define kStereoOut                         0x0800
  116. #define kReverse                         0x00010000            /*   function description */
  117. #define kRateConvert                     0x00020000
  118. #define kCreateSoundSource                 0x00040000
  119. #define kVMAwareness                     0x00200000            /*  component will hold its memory */
  120. #define kHighQuality                     0x00400000            /*   performance description */
  121. #define kNonRealTime                     0x00800000
  122.  
  123.  
  124. /*----------------------------snd  • Sound----------------------------------------------*/
  125. type 'snd ' {
  126.         switch {
  127.             case FormatOne:
  128.                 key unsigned integer = $0001;
  129.                 unsigned integer = $$CountOf(Synthesizers);
  130.                 wide array Synthesizers {
  131.                     /* Resource ID of synthesizer/modifer */
  132.                     integer        squareWaveSynth        = $0001,
  133.                                 waveTableSynth        = $0003,
  134.                                 sampledSynth        = $0005;
  135.                     longint;                                    /* init parameter        */
  136.                 };
  137.  
  138.             case FormatTwo:
  139.                 key unsigned integer = $0002;
  140.                 integer        free = 0, keepInMemory = 256+1;        /* Space for refe count    */
  141.         };
  142.         unsigned integer = $$CountOf(SoundCmnds);
  143.         wide array SoundCmnds {
  144.             boolean        noData, hasData;
  145.             switch {
  146.                 case nullCmd:
  147.                     key bitstring[15] = 0;
  148.                     fill word;                                    /* Param 1 = nil        */
  149.                     fill long;                                    /* Param 2 = nil        */
  150.                 case quietCmd:
  151.                     key bitstring[15] = 3;
  152.                     fill word;                                    /* Param 1 = nil        */
  153.                     fill long;                                    /* Param 2 = nil        */
  154.                 case flushCmd:
  155.                     key bitstring[15] = 4;
  156.                     fill word;                                    /* Param 1 = nil        */
  157.                     fill long;                                    /* Param 2 = nil        */
  158.                 case waitCmd:
  159.                     key bitstring[15] = 10;
  160.                     integer        oneSecond = 2000;                /* Duration                */
  161.                     fill long;                                    /* Param 2 = nil        */
  162.                 case pauseCmd:
  163.                     key bitstring[15] = 11;
  164.                     fill word;                                    /* Param 1 = nil        */
  165.                     fill long;                                    /* Param 2 = nil        */
  166.                 case resumeCmd:
  167.                     key bitstring[15] = 12;
  168.                     fill word;                                    /* Param 1 = nil        */
  169.                     fill long;                                    /* Param 2 = nil        */
  170.                 case callBackCmd:
  171.                     key bitstring[15] = 13;
  172.                     integer;                                    /* User-defined            */
  173.                     longint;                                    /* User-defined            */
  174.                 case syncCmd:
  175.                     key bitstring[15] = 14;
  176.                     integer;                                    /* Count                */
  177.                     longint;                                    /* Identifier            */
  178.                 case emptyCmd:
  179.                     key bitstring[15] = 15;
  180.                     fill word;                                    /* Param 1 = nil        */
  181.                     fill long;                                    /* Param 2 = nil        */
  182.                 case freqDurationCmd:
  183.                     key bitstring[15] = 40;
  184.                     integer        oneSecond = 2000;                /* Duration                */
  185.                     longint;                                    /* frequency            */
  186.                 case restCmd:
  187.                     key bitstring[15] = 41;
  188.                     integer        oneSecond = 2000;                /* Duration                */
  189.                     fill long;                                    /* Param 2 = nil        */
  190.                 case freqCmd:
  191.                     key bitstring[15] = 42;
  192.                     fill word;                                    /* Param 1 = nil        */
  193.                     longint;                                    /* Frequency            */
  194.                 case ampCmd:
  195.                     key bitstring[15] = 43;
  196.                     integer;                                    /* Amplitude            */
  197.                     fill long;                                    /* Param 2                */
  198.                 case timbreCmd:
  199.                     key bitstring[15] = 44;
  200.                     integer        sineWave, squareWave = 255;        /* Timbre                */
  201.                     fill long;                                    /* Param 2                */
  202.                 case waveTableCmd:
  203.                     key bitstring[15] = 60;
  204.                     unsigned integer;                            /* Length                */
  205.                     longint;                                    /* Pointer to table        */
  206.                 case phaseCmd:
  207.                     key bitstring[15] = 61;
  208.                     integer;                                    /* Shift                */
  209.                     longint;                                    /* chanPtr                */
  210.                 case soundCmd:
  211.                     key bitstring[15] = 80;
  212.                     fill word;                                    /* Param 1 = nil        */
  213.                     longint;                                    /* Pointer to sound        */
  214.                 case bufferCmd:
  215.                     key bitstring[15] = 81;
  216.                     fill word;                                    /* Param 1 = nil        */
  217.                     longint;                                    /* Pointer to buffer    */
  218.                 case rateCmd:
  219.                     key bitstring[15] = 82;
  220.                     fill word;                                    /* Param 1 = nil        */
  221.                     longint;                                    /* Rate                    */
  222.             };
  223.         };
  224.         array DataTables {
  225.     DataTable:
  226.             fill long;                                            /* Pointer to data        */
  227.     SampleCnt:
  228.             unsigned longint;                                    /* # of sound samples    */
  229.             unsigned hex longint
  230.                     Rate22K = $56EE8BA3;                        /* Sampling rate        */
  231.             unsigned longint;                                    /* Start of loop        */
  232.             unsigned longint;                                    /* End of loop            */
  233.             hex byte;                                            /* encode (header type)    */
  234.             hex byte;                                            /* baseFrequency        */
  235.             hex string [$$Long(SampleCnt[$$ArrayIndex(DataTables)])];
  236.         };
  237. };
  238.  
  239. #endif /* __SOUND_R__ */
  240.  
  241.